package org.glut.backend.controller;

import lombok.extern.slf4j.Slf4j;
import org.glut.backend.domain.StreetFood;
import org.glut.backend.service.IStreetFoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;
import java.util.Map;

/**
 * 小吃表 前端控制器
 *
 * @author xiuci1412
 * @since 2025-08-01 17:43
 */
@RestController
@RequestMapping("/streetFood")
@Slf4j
public class StreetFoodController {
    
    @Autowired
    private IStreetFoodService streetFoodService;

    /**
     * 根据ID查询
     */
    @GetMapping("/getList/{cinemaId}")
    public ResponseEntity<Map<Integer, List<StreetFood>>> getList(@PathVariable Integer cinemaId) {
        Map<Integer, List<StreetFood>> streetFoods = streetFoodService.getList(cinemaId);
        return ResponseEntity.ok().body(streetFoods);
    }

}